package com.cqhfan.chatroom.controller;

import com.cqhfan.chatroom.domain.po.User;
import com.cqhfan.chatroom.domain.vo.UserInfoVO;
import com.cqhfan.chatroom.service.IUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 眭传洪
 * @create 2024-11-14 19:53
 */
@Tag(name = "用户相关接口")
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final IUserService userService;

    @Operation(summary = "获取用户详细信息")
    @GetMapping("/getUserInfo")
    public UserInfoVO getUserInfo() {
        return userService.getUserInfo();
    }

    @Operation(summary = "修改用户信息")
    @PutMapping("/updateUserInfo")
    public void updateUserInfo(@RequestBody User user) {
        userService.updateUserInfo(user);
    }


}
